{
  "name": "ReviveBase Workflow v1",
  "nodes": [
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "0 10-18 * * 1,3,5"
            }
          ]
        }
      },
      "id": "65e5e25d-f0e5-4847-b0e3-597e760a3ec6",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -544,
        -280
      ]
    },
    {
      "parameters": {
        "operation": "search",
        "base": {
          "__rl": true,
          "value": "app79h4KIgOaNbBwQ",
          "mode": "list",
          "cachedResultName": "ReviveBase",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ"
        },
        "table": {
          "__rl": true,
          "value": "tbly9OWTkISddbInx",
          "mode": "list",
          "cachedResultName": "Clinics",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ/tbly9OWTkISddbInx"
        },
        "filterByFormula": "AND({SMSActive} = TRUE(), {LinkedClients} > 0)",
        "options": {}
      },
      "id": "a82d34f1-ba9d-411c-960a-404315c19925",
      "name": "Get Active Clinics",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.1,
      "position": [
        -320,
        -280
      ],
      "credentials": {
        "airtableTokenApi": {
          "id": "WNXc03B2GqCv6OG6",
          "name": "Airtable Personal Access Token account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Filter clinics by current time in their timezone\nconst clinics = $input.all();\nconst validClinics = [];\n\nfor (const item of clinics) {\n  const clinic = item.json;\n  const timezone = clinic.SMSTimeZoneUS;\n  \n  if (!timezone) continue;\n  \n  // Extract timezone identifier\n  const tzMatch = timezone.match(/^([^\\s]+)/);\n  if (!tzMatch) continue;\n  \n  const tz = tzMatch[1];\n  const now = new Date();\n  \n  // Get current hour in clinic timezone\n  const currentHour = parseInt(\n    now.toLocaleString('en-US', {\n      hour: 'numeric',\n      hour12: false,\n      timeZone: tz\n    })\n  );\n  \n  // Parse time window\n  const startHour = parseInt(clinic.SMSTimeWindowStart.split(':')[0]);\n  const endHour = parseInt(clinic.SMSTimeWindowEnd.split(':')[0]);\n  \n  // Check if within window\n  if (currentHour >= startHour && currentHour <= endHour) {\n    validClinics.push(item);\n  }\n}\n\nreturn validClinics;"
      },
      "id": "b8eebe1d-506d-4442-ba7c-62b031de49b6",
      "name": "Filter by Time Window",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -96,
        -272
      ]
    },
    {
      "parameters": {
        "operation": "search",
        "base": {
          "__rl": true,
          "value": "={{ $json.base.id }}",
          "mode": "id"
        },
        "table": {
          "__rl": true,
          "value": "Clients",
          "mode": "name"
        },
        "filterByFormula": "=AND({ClinicID} = '{{ $json.ClinicID }}', {Consent} = TRUE(), {Blacklisted} != TRUE(), OR(NOT({LastContacted}), DATETIME_DIFF(NOW(), {LastContacted}, 'days') >= {{ $json.SMSFrequency }}))",
        "options": {}
      },
      "id": "bdef1f14-f8db-4e92-bba2-bc34d051c15c",
      "name": "Get Eligible Clients",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.1,
      "position": [
        128,
        -280
      ],
      "credentials": {
        "airtableTokenApi": {
          "id": "WNXc03B2GqCv6OG6",
          "name": "Airtable Personal Access Token account"
        }
      }
    },
    {
      "parameters": {
        "path": "sms-webhook",
        "responseMode": "responseNode",
        "options": {
          "responseHeaders": {
            "entries": [
              {
                "name": "Content-Type",
                "value": "text/xml"
              }
            ]
          }
        }
      },
      "id": "013aabd9-7a95-4aa4-ad3a-d54cf93c6018",
      "name": "Twilio SMS Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -544,
        272
      ],
      "webhookId": "sms-receiver"
    },
    {
      "parameters": {
        "operation": "search",
        "base": {
          "__rl": true,
          "value": "app79h4KIgOaNbBwQ",
          "mode": "list",
          "cachedResultName": "ReviveBase",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ"
        },
        "table": {
          "__rl": true,
          "value": "tblncgTYrmEJJLZC8",
          "mode": "list",
          "cachedResultName": "Prompt Variants",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ/tblncgTYrmEJJLZC8"
        },
        "filterByFormula": "{Active} = TRUE()",
        "options": {}
      },
      "id": "093f4d92-cf6d-4e52-af8a-195e18939dc2",
      "name": "Get Prompt Variants",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.1,
      "position": [
        352,
        -280
      ],
      "credentials": {
        "airtableTokenApi": {
          "id": "WNXc03B2GqCv6OG6",
          "name": "Airtable Personal Access Token account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Select random variant for A/B testing\nconst variants = $('Get Prompt Variants').all();\nconst randomVariant = variants[Math.floor(Math.random() * variants.length)];\n\n// Get client and clinic data\nconst client = $('Get Eligible Clients').item.json;\nconst clinic = $('Filter by Time Window').item.json;\n\nreturn {\n  json: {\n    variant: randomVariant.json,\n    client: client,\n    clinic: clinic\n  }\n};"
      },
      "id": "4763d084-4ade-4c83-b242-ea1e45a9be89",
      "name": "Select Random Variant",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        576,
        -280
      ]
    },
    {
      "parameters": {
        "options": {
          "temperature": 0.7
        }
      },
      "id": "bda81e06-a188-4f1b-85eb-c102d94ab162",
      "name": "AI Message Composer",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1,
      "position": [
        896,
        -160
      ],
      "credentials": {
        "openAiApi": {
          "id": "C8SQwEzOgks5HQim",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.variant.Variant }} {{ $json.client.ClientName }}, it's been a while since your {{ $json.client.PreferredTreatment || 'last treatment' }}! Book now and get a $100 voucher for just $50. Reply YES to claim yours!"
      },
      "id": "80b35c25-1396-4e4f-9fec-325d21badb88",
      "name": "Generate SMS",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.4,
      "position": [
        800,
        -384
      ]
    },
    {
      "parameters": {
        "from": "={{ $json.clinic.TwilioNumber }}",
        "to": "={{ $json.client.Phone }}",
        "message": "={{ $json.text }}",
        "options": {}
      },
      "id": "1e1c6045-00a1-418f-9e14-d88c236b5609",
      "name": "Send SMS",
      "type": "n8n-nodes-base.twilio",
      "typeVersion": 1,
      "position": [
        1200,
        -280
      ],
      "credentials": {
        "twilioApi": {
          "id": "FPr1RwE1ub4AoMji",
          "name": "Twilio account"
        }
      }
    },
    {
      "parameters": {
        "operation": "create",
        "base": {
          "__rl": true,
          "value": "app79h4KIgOaNbBwQ",
          "mode": "list",
          "cachedResultName": "ReviveBase",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ"
        },
        "table": {
          "__rl": true,
          "value": "tblrxsx7S3dRcAQhn",
          "mode": "list",
          "cachedResultName": "SMS Log",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ/tblrxsx7S3dRcAQhn"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "ClientPhone": "={{ $('Select Random Variant').item.json.client.Phone }}",
            "ClinicID": [
              "={{ $('Select Random Variant').item.json.clinic.ClinicID }}"
            ],
            "SMS": "={{ $('Generate SMS').item.json.text }}",
            "Timestamp": "={{ $now.toISO() }}",
            "SMSIndex": 1,
            "PromptVariant": [
              "={{ $('Select Random Variant').item.json.variant.VariantID }}"
            ]
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "LogSummary",
              "displayName": "LogSummary",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": true,
              "removed": false
            },
            {
              "id": "LogID",
              "displayName": "LogID",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": true,
              "removed": false
            },
            {
              "id": "ClientPhone",
              "displayName": "ClientPhone",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false
            },
            {
              "id": "ClinicID",
              "displayName": "ClinicID",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "array",
              "readOnly": false
            },
            {
              "id": "SMS",
              "displayName": "SMS",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Timestamp",
              "displayName": "Timestamp",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "dateTime",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "SMSIndex",
              "displayName": "SMSIndex",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "PromptVariant",
              "displayName": "PromptVariant",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "array",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Variant (from PromptVariant)",
              "displayName": "Variant (from PromptVariant)",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": true,
              "removed": false
            },
            {
              "id": "Headline (SMS)",
              "displayName": "Headline (SMS)",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "ca30d54e-bc03-4836-b517-9b49da05cf12",
      "name": "Log SMS to Airtable",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.1,
      "position": [
        1424,
        -280
      ],
      "credentials": {
        "airtableTokenApi": {
          "id": "WNXc03B2GqCv6OG6",
          "name": "Airtable Personal Access Token account"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "base": {
          "__rl": true,
          "value": "app79h4KIgOaNbBwQ",
          "mode": "list",
          "cachedResultName": "ReviveBase",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ"
        },
        "table": {
          "__rl": true,
          "value": "tblTjmY0FTJVLAQcF",
          "mode": "list",
          "cachedResultName": "Clients",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ/tblTjmY0FTJVLAQcF"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "LastContacted": "={{ $now.toISO() }}",
            "SMSCount": "={{ ($('Select Random Variant').item.json.client.SMSCount || 0) + 1 }}",
            "TotalSpend": 0,
            "EngagementScore": 0
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "string",
              "readOnly": true,
              "removed": false
            },
            {
              "id": "ClientName",
              "displayName": "ClientName",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "ClientID",
              "displayName": "ClientID",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": true,
              "removed": false
            },
            {
              "id": "Phone",
              "displayName": "Phone",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "TreatmentHistory",
              "displayName": "TreatmentHistory",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Consent",
              "displayName": "Consent",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "boolean",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "ClinicID",
              "displayName": "ClinicID",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "array",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "ClientStatus",
              "displayName": "ClientStatus",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "options",
              "options": [
                {
                  "name": "Active",
                  "value": "Active"
                },
                {
                  "name": "Inactive",
                  "value": "Inactive"
                },
                {
                  "name": "Prospect",
                  "value": "Prospect"
                }
              ],
              "readOnly": false,
              "removed": false
            },
            {
              "id": "PreferredTreatment",
              "displayName": "PreferredTreatment",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "LastContacted",
              "displayName": "LastContacted",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "dateTime",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Blacklisted",
              "displayName": "Blacklisted",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "boolean",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Email",
              "displayName": "Email",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "LastTreatmentDate",
              "displayName": "LastTreatmentDate",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "dateTime",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "SMSCount",
              "displayName": "SMSCount",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "ConversationHistory",
              "displayName": "ConversationHistory",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "TotalSpend",
              "displayName": "TotalSpend",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "OptOutDate",
              "displayName": "OptOutDate",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "dateTime",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "LastPromptVariant",
              "displayName": "LastPromptVariant",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "array",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "EngagementScore",
              "displayName": "EngagementScore",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "0bcba000-3106-4034-9629-0c3c2da648ae",
      "name": "Update Client Last Contacted",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.1,
      "position": [
        1648,
        -272
      ],
      "credentials": {
        "airtableTokenApi": {
          "id": "WNXc03B2GqCv6OG6",
          "name": "Airtable Personal Access Token account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "// Parse Twilio webhook data\nconst data = $input.first().json;\n\nreturn {\n  json: {\n    from: data.From,\n    to: data.To,\n    body: data.Body,\n    messageSid: data.MessageSid,\n    timestamp: new Date().toISOString()\n  }\n};"
      },
      "id": "ca0620db-e52a-42bb-8445-f0ac60cdfba5",
      "name": "Parse Incoming SMS",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -320,
        272
      ]
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 1
          },
          "conditions": [
            {
              "leftValue": "={{ $json.body.toUpperCase() }}",
              "rightValue": "STOP",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "id": "2dc0b160-64f3-4950-9e67-29faca4afc3f"
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "88abcc57-7f17-4601-a7db-66a876a65e99",
      "name": "Check for STOP",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        528,
        416
      ]
    },
    {
      "parameters": {
        "operation": "search",
        "base": {
          "__rl": true,
          "value": "app79h4KIgOaNbBwQ",
          "mode": "list",
          "cachedResultName": "ReviveBase",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ"
        },
        "table": {
          "__rl": true,
          "value": "tblTjmY0FTJVLAQcF",
          "mode": "list",
          "cachedResultName": "Clients",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ/tblTjmY0FTJVLAQcF"
        },
        "filterByFormula": "={Phone} = '{{ $json.from }}'",
        "options": {}
      },
      "id": "b4e694c2-44de-4ada-aa47-002f7261aaa9",
      "name": "Find Client by Phone",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.1,
      "position": [
        752,
        416
      ],
      "credentials": {
        "airtableTokenApi": {
          "id": "WNXc03B2GqCv6OG6",
          "name": "Airtable Personal Access Token account"
        }
      }
    },
    {
      "parameters": {
        "operation": "update",
        "base": {
          "__rl": true,
          "value": "app79h4KIgOaNbBwQ",
          "mode": "list",
          "cachedResultName": "ReviveBase",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ"
        },
        "table": {
          "__rl": true,
          "value": "tblTjmY0FTJVLAQcF",
          "mode": "list",
          "cachedResultName": "Clients",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ/tblTjmY0FTJVLAQcF"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "Consent": false,
            "Blacklisted": false
          },
          "matchingColumns": [
            "id"
          ],
          "schema": [
            {
              "id": "id",
              "displayName": "id",
              "required": false,
              "defaultMatch": true,
              "display": true,
              "type": "string",
              "readOnly": true,
              "removed": false
            },
            {
              "id": "ClientName",
              "displayName": "ClientName",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "ClientID",
              "displayName": "ClientID",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": true,
              "removed": true
            },
            {
              "id": "Phone",
              "displayName": "Phone",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "TreatmentHistory",
              "displayName": "TreatmentHistory",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Consent",
              "displayName": "Consent",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "boolean",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "ClinicID",
              "displayName": "ClinicID",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "array",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "ClientStatus",
              "displayName": "ClientStatus",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "options",
              "options": [
                {
                  "name": "Active",
                  "value": "Active"
                },
                {
                  "name": "Inactive",
                  "value": "Inactive"
                },
                {
                  "name": "Prospect",
                  "value": "Prospect"
                }
              ],
              "readOnly": false,
              "removed": false
            },
            {
              "id": "PreferredTreatment",
              "displayName": "PreferredTreatment",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "LastContacted",
              "displayName": "LastContacted",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "dateTime",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Blacklisted",
              "displayName": "Blacklisted",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "boolean",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Email",
              "displayName": "Email",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "LastTreatmentDate",
              "displayName": "LastTreatmentDate",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "dateTime",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "SMSCount",
              "displayName": "SMSCount",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "ConversationHistory",
              "displayName": "ConversationHistory",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "TotalSpend",
              "displayName": "TotalSpend",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "OptOutDate",
              "displayName": "OptOutDate",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "dateTime",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "LastPromptVariant",
              "displayName": "LastPromptVariant",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "array",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "EngagementScore",
              "displayName": "EngagementScore",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "7512f8d6-7fc9-493d-ac3e-cf3372739b30",
      "name": "Blacklist Client",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.1,
      "position": [
        976,
        420
      ],
      "credentials": {
        "airtableTokenApi": {
          "id": "WNXc03B2GqCv6OG6",
          "name": "Airtable Personal Access Token account"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.body }}",
        "hasOutputParser": true,
        "messages": {
          "messageValues": [
            {
              "message": "Analyze this SMS response for booking intent. Classify as:\n- positive_booking: Customer wants to book or is interested\n- negative: Not interested\n- question: Has questions\n- no_intent: Unclear\n\nRespond with JSON only: {\"intent\": \"category\", \"shouldSendPaymentLink\": boolean}"
            }
          ]
        }
      },
      "id": "5f8e10aa-fb66-4c45-932c-8e0e73ca224a",
      "name": "AI Intent Analysis",
      "type": "@n8n/n8n-nodes-langchain.chainLlm",
      "typeVersion": 1.4,
      "position": [
        -96,
        160
      ]
    },
    {
      "parameters": {
        "jsonSchema": "{\n  \"type\": \"object\",\n  \"properties\": {\n    \"intent\": {\n      \"type\": \"string\",\n      \"enum\": [\"positive_booking\", \"negative\", \"question\", \"no_intent\"]\n    },\n    \"shouldSendPaymentLink\": {\n      \"type\": \"boolean\"\n    }\n  },\n  \"required\": [\"intent\", \"shouldSendPaymentLink\"]\n}"
      },
      "id": "4933e9ed-ff7e-474e-af75-861bba1a230d",
      "name": "JSON Parser",
      "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
      "typeVersion": 1,
      "position": [
        64,
        376
      ]
    },
    {
      "parameters": {
        "model": "gpt-4o",
        "options": {
          "temperature": 0.3
        }
      },
      "id": "cf114cfd-df48-4302-a36b-1e2246bc1f7b",
      "name": "OpenAI Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1,
      "position": [
        -64,
        376
      ],
      "credentials": {
        "openAiApi": {
          "id": "C8SQwEzOgks5HQim",
          "name": "OpenAi account"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 1
          },
          "conditions": [
            {
              "leftValue": "={{ $json.output.intent }}",
              "rightValue": "positive_booking",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "id": "5080fdaf-c824-4cdf-afdb-faf1dcf5e562"
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "00f9c162-99b0-41c0-8212-a30fad175105",
      "name": "Check Positive Intent",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        304,
        152
      ]
    },
    {
      "parameters": {
        "operation": "search",
        "base": {
          "__rl": true,
          "value": "app79h4KIgOaNbBwQ",
          "mode": "list",
          "cachedResultName": "ReviveBase",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ"
        },
        "table": {
          "__rl": true,
          "value": "tbly9OWTkISddbInx",
          "mode": "list",
          "cachedResultName": "Clinics",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ/tbly9OWTkISddbInx"
        },
        "filterByFormula": "={TwilioNumber} = '{{ $('Parse Incoming SMS').item.json.to }}'",
        "options": {}
      },
      "id": "c4087592-5b7a-438d-9d47-f7e2cd4f9d98",
      "name": "Get Clinic Info",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.1,
      "position": [
        528,
        80
      ],
      "credentials": {
        "airtableTokenApi": {
          "id": "WNXc03B2GqCv6OG6",
          "name": "Airtable Personal Access Token account"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.stripe.com/v1/checkout/sessions",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "stripeApi",
        "sendBody": true,
        "contentType": "form-urlencoded",
        "bodyParameters": {
          "parameters": [
            {
              "name": "payment_method_types[0]",
              "value": "card"
            },
            {
              "name": "line_items[0][price_data][currency]",
              "value": "usd"
            },
            {
              "name": "line_items[0][price_data][unit_amount]",
              "value": "5000"
            },
            {
              "name": "line_items[0][price_data][product_data][name]",
              "value": "Med Spa Treatment Voucher ($100 value)"
            },
            {
              "name": "line_items[0][quantity]",
              "value": "1"
            },
            {
              "name": "mode",
              "value": "payment"
            },
            {
              "name": "success_url",
              "value": "https://yourapp.com/success?session_id={CHECKOUT_SESSION_ID}"
            },
            {
              "name": "cancel_url",
              "value": "https://yourapp.com/cancel"
            },
            {
              "name": "metadata[phone]",
              "value": "={{ $('Parse Incoming SMS').item.json.from }}"
            },
            {
              "name": "metadata[clinic_id]",
              "value": "={{ $json.ClinicID }}"
            },
            {
              "name": "metadata[clinic_name]",
              "value": "={{ $json.ClinicName }}"
            }
          ]
        },
        "options": {}
      },
      "id": "fec97404-36d1-4465-acea-96296df20325",
      "name": "Create Stripe Checkout",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        752,
        80
      ]
    },
    {
      "parameters": {
        "from": "={{ $('Get Clinic Info').item.json.TwilioNumber }}",
        "to": "={{ $('Parse Incoming SMS').item.json.from }}",
        "message": "Great! Here's your exclusive offer from {{ $('Get Clinic Info').item.json.ClinicName }}: Get a $100 treatment voucher for just $50!\n\nSecure yours now: {{ $json.url }}\n\nThis link expires in 24 hours.",
        "options": {}
      },
      "id": "64f3875b-cc3e-40a9-8afc-44a44d8a1074",
      "name": "Send Payment Link",
      "type": "n8n-nodes-base.twilio",
      "typeVersion": 1,
      "position": [
        976,
        80
      ],
      "credentials": {
        "twilioApi": {
          "id": "FPr1RwE1ub4AoMji",
          "name": "Twilio account"
        }
      }
    },
    {
      "parameters": {
        "options": {
          "responseCode": 200
        }
      },
      "id": "1516bd62-e071-4b3b-90ae-b7c70b03e7c6",
      "name": "Send Twilio Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        1200,
        224
      ]
    },
    {
      "parameters": {
        "path": "stripe-webhook",
        "responseMode": "responseNode",
        "options": {}
      },
      "id": "0d411235-6f0d-4f1f-8a31-b950127193b5",
      "name": "Stripe Payment Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        -544,
        816
      ],
      "webhookId": "stripe-payment"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 1
          },
          "conditions": [
            {
              "leftValue": "={{ $json.type }}",
              "rightValue": "checkout.session.completed",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "id": "b1b25389-83a6-418e-85a9-fe5380f1b632"
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "id": "5d4a133d-044a-4443-97ff-908f790c286d",
      "name": "Verify Payment Success",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        -320,
        812
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.pub1.passkit.io/members/member",
        "authentication": "predefinedCredentialType",
        "nodeCredentialType": "httpHeaderAuth",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "templateId",
              "value": "={{ $json.data.object.metadata.clinic_id }}"
            },
            {
              "name": "person.displayName",
              "value": "Customer"
            },
            {
              "name": "person.mobileNumber",
              "value": "={{ $json.data.object.metadata.phone }}"
            },
            {
              "name": "metaData.clinicName",
              "value": "={{ $json.data.object.metadata.clinic_name }}"
            },
            {
              "name": "metaData.couponValue",
              "value": "100"
            },
            {
              "name": "metaData.purchaseAmount",
              "value": "50"
            },
            {
              "name": "metaData.validUntil",
              "value": "={{ $now.plus({days: 30}).toISO() }}"
            },
            {
              "name": "metaData.stripeSessionId",
              "value": "={{ $json.data.object.id }}"
            }
          ]
        },
        "options": {}
      },
      "id": "43b7b3a3-a5fb-4d9f-99c3-e3999c25311a",
      "name": "Create PassKit Coupon",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -96,
        736
      ]
    },
    {
      "parameters": {
        "from": "+14155550101",
        "to": "={{ $json.data.object.metadata.phone }}",
        "message": "🎉 Payment confirmed! Your $100 voucher is ready:\n\n📱 Add to phone: {{ $('Create PassKit Coupon').item.json.url }}\n\nShow this at your appointment to save $100. Valid for 30 days.",
        "options": {}
      },
      "id": "d9d8daf1-1441-4d49-b036-233b63e5671c",
      "name": "Send Coupon via SMS",
      "type": "n8n-nodes-base.twilio",
      "typeVersion": 1,
      "position": [
        128,
        644
      ],
      "credentials": {
        "twilioApi": {
          "id": "FPr1RwE1ub4AoMji",
          "name": "Twilio account"
        }
      }
    },
    {
      "parameters": {
        "operation": "create",
        "base": {
          "__rl": true,
          "value": "app79h4KIgOaNbBwQ",
          "mode": "list",
          "cachedResultName": "ReviveBase",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ"
        },
        "table": {
          "__rl": true,
          "value": "tblBRqkTH8QOvktVj",
          "mode": "list",
          "cachedResultName": "SMS Analytics",
          "cachedResultUrl": "https://airtable.com/app79h4KIgOaNbBwQ/tblBRqkTH8QOvktVj"
        },
        "columns": {
          "mappingMode": "defineBelow",
          "value": {
            "ClientPhone": "={{ $json.data.object.metadata.phone }}",
            "ClinicID": [
              "={{ $json.data.object.metadata.clinic_id }}"
            ],
            "Intent": "positive_booking",
            "Response": "Payment completed - Coupon issued",
            "Timestamp": "={{ $now.toISO() }}",
            "Simulation": false,
            "RedemptionStatus": "Not Scanned",
            "ConversionValue": 0,
            "PromptVariantScore": 0,
            "MessageLength": 0
          },
          "matchingColumns": [],
          "schema": [
            {
              "id": "InteractionSummary",
              "displayName": "InteractionSummary",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": true,
              "removed": false
            },
            {
              "id": "AnalyticsID",
              "displayName": "AnalyticsID",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": true,
              "removed": false
            },
            {
              "id": "ClientPhone",
              "displayName": "ClientPhone",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "ClinicID",
              "displayName": "ClinicID",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "array",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "SMS",
              "displayName": "SMS",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Intent",
              "displayName": "Intent",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "options",
              "options": [
                {
                  "name": "opt_out",
                  "value": "opt_out"
                },
                {
                  "name": "positive_booking",
                  "value": "positive_booking"
                },
                {
                  "name": "negative",
                  "value": "negative"
                },
                {
                  "name": "question",
                  "value": "question"
                },
                {
                  "name": "no_intent",
                  "value": "no_intent"
                }
              ],
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Response",
              "displayName": "Response",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Timestamp",
              "displayName": "Timestamp",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "dateTime",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "VariantLink",
              "displayName": "VariantLink",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "array",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "VariantID (from VariantLink)",
              "displayName": "VariantID (from VariantLink)",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": true,
              "removed": false
            },
            {
              "id": "PromptVariant",
              "displayName": "PromptVariant",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Simulation",
              "displayName": "Simulation",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "boolean",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "RedemptionStatus",
              "displayName": "RedemptionStatus",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "options",
              "options": [
                {
                  "name": "Not Scanned",
                  "value": "Not Scanned"
                },
                {
                  "name": "Scanned",
                  "value": "Scanned"
                },
                {
                  "name": "Expired",
                  "value": "Expired"
                },
                {
                  "name": "Invalid",
                  "value": "Invalid"
                }
              ],
              "readOnly": false,
              "removed": false
            },
            {
              "id": "ConversionValue",
              "displayName": "ConversionValue",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "PromptVariantScore",
              "displayName": "PromptVariantScore",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "Reply",
              "displayName": "Reply",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "MessageLength",
              "displayName": "MessageLength",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "number",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "CouponIssued",
              "displayName": "CouponIssued",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "boolean",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "StripeSessionId",
              "displayName": "StripeSessionId",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "PassKitCouponId",
              "displayName": "PassKitCouponId",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "PassKitCouponUrl",
              "displayName": "PassKitCouponUrl",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            },
            {
              "id": "PaymentAmount",
              "displayName": "PaymentAmount",
              "required": false,
              "defaultMatch": false,
              "canBeUsedToMatch": true,
              "display": true,
              "type": "string",
              "readOnly": false,
              "removed": false
            }
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {}
      },
      "id": "b41ba64d-a835-4ee5-b653-142dc444d357",
      "name": "Log Success Analytics",
      "type": "n8n-nodes-base.airtable",
      "typeVersion": 2.1,
      "position": [
        128,
        832
      ],
      "credentials": {
        "airtableTokenApi": {
          "id": "WNXc03B2GqCv6OG6",
          "name": "Airtable Personal Access Token account"
        }
      }
    },
    {
      "parameters": {
        "options": {
          "responseCode": 200
        }
      },
      "id": "dd7d310d-daf0-4b14-99af-97c20ecdde8e",
      "name": "Stripe Webhook Response",
      "type": "n8n-nodes-base.respondToWebhook",
      "typeVersion": 1.1,
      "position": [
        352,
        836
      ]
    }
  ],
  "pinData": {},
  "connections": {
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Get Active Clinics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Active Clinics": {
      "main": [
        [
          {
            "node": "Filter by Time Window",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Filter by Time Window": {
      "main": [
        [
          {
            "node": "Get Eligible Clients",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Eligible Clients": {
      "main": [
        [
          {
            "node": "Get Prompt Variants",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Prompt Variants": {
      "main": [
        [
          {
            "node": "Select Random Variant",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Select Random Variant": {
      "main": [
        [
          {
            "node": "Generate SMS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Message Composer": {
      "ai_languageModel": [
        [
          {
            "node": "Generate SMS",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Generate SMS": {
      "main": [
        [
          {
            "node": "Send SMS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send SMS": {
      "main": [
        [
          {
            "node": "Log SMS to Airtable",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log SMS to Airtable": {
      "main": [
        [
          {
            "node": "Update Client Last Contacted",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Twilio SMS Webhook": {
      "main": [
        [
          {
            "node": "Parse Incoming SMS",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Incoming SMS": {
      "main": [
        [
          {
            "node": "Check for STOP",
            "type": "main",
            "index": 0
          },
          {
            "node": "AI Intent Analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check for STOP": {
      "main": [
        [
          {
            "node": "Find Client by Phone",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Client by Phone": {
      "main": [
        [
          {
            "node": "Blacklist Client",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Blacklist Client": {
      "main": [
        [
          {
            "node": "Send Twilio Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "OpenAI Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Intent Analysis",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "JSON Parser": {
      "ai_outputParser": [
        [
          {
            "node": "AI Intent Analysis",
            "type": "ai_outputParser",
            "index": 0
          }
        ]
      ]
    },
    "AI Intent Analysis": {
      "main": [
        [
          {
            "node": "Check Positive Intent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check Positive Intent": {
      "main": [
        [
          {
            "node": "Get Clinic Info",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send Twilio Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Clinic Info": {
      "main": [
        [
          {
            "node": "Create Stripe Checkout",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create Stripe Checkout": {
      "main": [
        [
          {
            "node": "Send Payment Link",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Payment Link": {
      "main": [
        [
          {
            "node": "Send Twilio Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Stripe Payment Webhook": {
      "main": [
        [
          {
            "node": "Verify Payment Success",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Verify Payment Success": {
      "main": [
        [
          {
            "node": "Create PassKit Coupon",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Stripe Webhook Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create PassKit Coupon": {
      "main": [
        [
          {
            "node": "Send Coupon via SMS",
            "type": "main",
            "index": 0
          },
          {
            "node": "Log Success Analytics",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Log Success Analytics": {
      "main": [
        [
          {
            "node": "Stripe Webhook Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Coupon via SMS": {
      "main": [
        [
          {
            "node": "Stripe Webhook Response",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "f4234220-a886-4569-bc21-100b80943b66",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "1ebaca2b89564222fb329d6e10b2ef9df1c2856dbf4ae64148b6762776d592a3"
  },
  "id": "CXoaTm5s2QYEzZTT",
  "tags": []
}